home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 June: Reference Library / Dev.CD Jun 94.toast / Periodicals / develop / develop Issue 9 / develop 9 code / TermWindow / SampleTermWindow.r < prev    next >
Encoding:
Text File  |  1992-01-06  |  5.4 KB  |  260 lines  |  [TEXT/MPS ]

  1. /******************************************************************************
  2. **
  3. **  Project Name:    SampleTermWindow
  4. **     File Name:    SampleTermWindow.r
  5. **
  6. **   Description:    Contains common constants
  7. **
  8. **                       Copyright © 1988-1991 Apple Computer, Inc.
  9. **                       All rights reserved.
  10. **
  11. *******************************************************************************
  12. **                       A U T H O R   I D E N T I T Y
  13. *******************************************************************************
  14. **
  15. **    Initials    Name
  16. **    --------    -----------------------------------------------
  17. **    CSH            Craig Hotchkiss
  18. **
  19. *******************************************************************************
  20. **                      R E V I S I O N   H I S T O R Y
  21. *******************************************************************************
  22. **
  23. **
  24. ******************************************************************************/
  25.  
  26.  
  27. #include "SysTypes.r"
  28. #include "Types.r"
  29.  
  30. #include "SampleTermWindow.h"
  31.  
  32. resource 'vers' (1) {
  33.     0x02, 0x00, release, 0x00,
  34.     verUS,
  35.     "1.1",
  36.     "1.1, Copyright \251 Apple Computer, Inc. 1989-1991"
  37. };
  38.  
  39.  
  40. /* we use an MBAR resource to conveniently load all the menus */
  41.  
  42. resource 'MBAR' (rMenuBar, preload) {
  43.     { mApple, mFile, mEdit, mLight };    /* four menus */
  44. };
  45.  
  46.  
  47. resource 'MENU' (mApple, preload) {
  48.     mApple, textMenuProc,
  49.     AllItems & ~MenuItem2,    /* Disable dashed line, enable About and DAs */
  50.     enabled, apple,
  51.     {
  52.         "About Sample…",
  53.             noicon, nokey, nomark, plain;
  54.         "-",
  55.             noicon, nokey, nomark, plain
  56.     }
  57. };
  58.  
  59. resource 'MENU' (mFile, preload) {
  60.     mFile, textMenuProc,
  61.     MenuItem12,                /* enable Quit only, program enables others */
  62.     enabled, "File",
  63.     {
  64.         "New",
  65.             noicon, "N", nomark, plain;
  66.         "Open",
  67.             noicon, "O", nomark, plain;
  68.         "-",
  69.             noicon, nokey, nomark, plain;
  70.         "Close",
  71.             noicon, "W", nomark, plain;
  72.         "Save",
  73.             noicon, "S", nomark, plain;
  74.         "Save As…",
  75.             noicon, nokey, nomark, plain;
  76.         "Revert",
  77.             noicon, nokey, nomark, plain;
  78.         "-",
  79.             noicon, nokey, nomark, plain;
  80.         "Page Setup…",
  81.             noicon, nokey, nomark, plain;
  82.         "Print…",
  83.             noicon, nokey, nomark, plain;
  84.         "-",
  85.             noicon, nokey, nomark, plain;
  86.         "Quit",
  87.             noicon, "Q", nomark, plain
  88.     }
  89. };
  90.  
  91. resource 'MENU' (mEdit, preload) {
  92.     mEdit, textMenuProc,
  93.     NoItems,                /* disable everything, program does the enabling */
  94.     enabled, "Edit",
  95.      {
  96.         "Undo",
  97.             noicon, "Z", nomark, plain;
  98.         "-",
  99.             noicon, nokey, nomark, plain;
  100.         "Cut",
  101.             noicon, "X", nomark, plain;
  102.         "Copy",
  103.             noicon, "C", nomark, plain;
  104.         "Paste",
  105.             noicon, "V", nomark, plain;
  106.         "Clear",
  107.             noicon, nokey, nomark, plain
  108.     }
  109. };
  110.  
  111. resource 'MENU' (mLight, preload) {
  112.     mLight, textMenuProc,
  113.     NoItems,                /* disable everything, program does the enabling */
  114.     enabled, "Traffic",
  115.      {
  116.         "Red Light",
  117.             noicon, nokey, nomark, plain;
  118.         "Green Light",
  119.             noicon, nokey, nomark, plain;
  120.         "-",
  121.             noicon, nokey, nomark, plain;
  122.         "Fill TermWindow",
  123.             noicon, "T", nomark, plain
  124.     }
  125. };
  126.  
  127.  
  128. /* this ALRT and DITL are used as an About screen */
  129.  
  130. resource 'ALRT' (rAboutAlert, purgeable) {
  131.     {40, 20, 160, 297},
  132.     rAboutAlert,
  133.     { /* array: 4 elements */
  134.         /* [1] */
  135.         OK, visible, silent,
  136.         /* [2] */
  137.         OK, visible, silent,
  138.         /* [3] */
  139.         OK, visible, silent,
  140.         /* [4] */
  141.         OK, visible, silent
  142.     }
  143. };
  144.  
  145. resource 'DITL' (rAboutAlert, purgeable) {
  146.     { /* array DITLarray: 5 elements */
  147.         /* [1] */
  148.         {88, 185, 108, 265},
  149.         Button {
  150.             enabled,
  151.             "OK"
  152.         },
  153.         /* [2] */
  154.         {8, 8, 24, 214},
  155.         StaticText {
  156.             disabled,
  157.             "Traffic Light with TermWindow"
  158.         },
  159.         /* [3] */
  160.         {32, 8, 48, 296},
  161.         StaticText {
  162.             disabled,
  163.             "Copyright © Apple Computer 1989-1991"
  164.         },
  165.         /* [4] */
  166.         {56, 8, 72, 136},
  167.         StaticText {
  168.             disabled,
  169.             "Brought to you by:"
  170.         },
  171.         /* [5] */
  172.         {80, 24, 112, 167},
  173.         StaticText {
  174.             disabled,
  175.             "MacDTS & Craig"
  176.         }
  177.     }
  178. };
  179.  
  180.  
  181. /* this ALRT and DITL are used as an error screen */
  182.  
  183. resource 'ALRT' (rUserAlert, purgeable) {
  184.     {40, 20, 120, 260},
  185.     rUserAlert,
  186.     { /* array: 4 elements */
  187.         /* [1] */
  188.         OK, visible, silent,
  189.         /* [2] */
  190.         OK, visible, silent,
  191.         /* [3] */
  192.         OK, visible, silent,
  193.         /* [4] */
  194.         OK, visible, silent
  195.     }
  196. };
  197.  
  198.  
  199. resource 'DITL' (rUserAlert, purgeable) {
  200.     { /* array DITLarray: 3 elements */
  201.         /* [1] */
  202.         {50, 150, 70, 230},
  203.         Button {
  204.             enabled,
  205.             "OK"
  206.         },
  207.         /* [2] */
  208.         {10, 60, 30, 230},
  209.         StaticText {
  210.             disabled,
  211.             "Sample - Error occurred!"
  212.         },
  213.         /* [3] */
  214.         {8, 8, 40, 40},
  215.         Icon {
  216.             disabled,
  217.             2
  218.         }
  219.     }
  220. };
  221.  
  222.  
  223. resource 'WIND' (rWindow, preload, purgeable) {
  224.     {60, 40, 290, 160},
  225.     noGrowDocProc, visible, noGoAway, 0x0, "Traffic"
  226. };
  227.  
  228. resource 'RECT' (rStopRect, preload, purgeable) {
  229.     {10, 10, 110, 110}
  230. };
  231.  
  232. resource 'RECT' (rGoRect, preload, purgeable) {
  233.     {120, 10, 220, 110}
  234. };
  235.  
  236.  
  237. /* here is the quintessential MultiFinder friendliness device, the SIZE resource */
  238.  
  239. resource 'SIZE' (-1) {
  240.     dontSaveScreen,
  241.     acceptSuspendResumeEvents,
  242.     enableOptionSwitch,
  243.     canBackground,                /* we can background; we don't currently, but our sleep value */
  244.                                 /* guarantees we don't hog the Mac while we are in the background */
  245.     multiFinderAware,            /* this says we do our own activate/deactivate; don't fake us out */
  246.     backgroundAndForeground,    /* this is definitely not a background-only application! */
  247.     dontGetFrontClicks,            /* change this is if you want "do first click" behavior like the Finder */
  248.     ignoreChildDiedEvents,        /* essentially, I'm not a debugger (sub-launching) */
  249.     not32BitCompatible,            /* this app should not be run in 32-bit address space */
  250.     reserved,
  251.     reserved,
  252.     reserved,
  253.     reserved,
  254.     reserved,
  255.     reserved,
  256.     reserved,
  257.     kPrefSize * 1024,
  258.     kMinSize * 1024    
  259. };
  260.